-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Block: Add missing viewScriptModule
field
#59140
Create Block: Add missing viewScriptModule
field
#59140
Conversation
Size Change: 0 B Total Size: 1.7 MB ℹ️ View Unchanged
|
npx @wordpress/create-block --template @wordpress/create-block-interactive-template | ||
npx @wordpress/create-block --template @wordpress/create-block-interactive-template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fix
Flaky tests detected in 43288b8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7939878334
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you SO MUCH for this PR. It was on my radar 🎉
@c4rl0sbr4v0 Thanks for the review! My understanding is that the |
We should publish it then asap. I guess we will publish npm packages on Monday or Tuesday before the Beta 2. |
I'm not familiar with how npm packages are released. Perhaps @gziolo knows more? |
@@ -32,6 +32,7 @@ async function initBlockJSON( { | |||
viewStyle, | |||
render, | |||
viewModule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need viewModule
anymore in @wordpress/create-block
. It's been replaced with viewScriptModule
in all places now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! I would like to submit a follow-up PR.
@t-hamano is correct. There is nothing to backport to WordPress core here as there is no production code included. At this period of WP major release, npm publishing with bug fixes doesn't target npm with the |
Thanks for noticing and handling this @t-hamano 🙌 |
Follow up #58211
What?
I noticed that when specifying an interactivity template in the
create-block
package, theviewScriptModule
was not added toblock.json
, so the block did not work as expected on the front end.Why?
In #58211, a field was added to the interactivity template side, but it appears that the field is not added to the create-block package that actually generates
block.json
.Testing Instructions
path/to/gutenberg/packages/create-block/index.js test-block --template path/to/gutenberg/packages/create-block-interactive-template
src/block.json
file.Before
After
Also run the following command and make sure that no unintended fields are added to block.json as before.
path/to/gutenberg/packages/create-block/index.js test-block
path/to/gutenberg/packages/create-block/index.js test-block --template path/to/gutenberg/packages/create-block-tutorial-template